nodes:
{% for node in groups['k8s_cluster'] %}
    - address: {{ hostvars[node]['ansible_host'] | default(hostvars[node]['inventory_hostname']) }}
      user: {{ rke_user }}
      hostname_override: {{ hostvars[node]['ansible_host'] | default(hostvars[node]['inventory_hostname']) | replace('.', '-') }}
      role:
{% if node in groups['k8s_masters'] %}
        - controlplane
{% endif %}
{% if node in groups['k8s_workers'] %}
        - worker
{% endif %}
{% if node in groups['k8s_etcd'] %}
        - etcd
{% endif %}
{% endfor %}

{% if nexus_docker_proxy is defined %}
private_registries:
    - url: {{ nexus_docker_proxy | replace('/', '') }}
      is_default: true
{% endif %}

{% if rke_cluster_extra_config is defined %}
{{ rke_cluster_extra_config | to_nice_yaml | indent(first=True, width=0) }}
{% endif %}